package com.bolun998300.personal_blog_springboot.dao;

import com.bolun998300.personal_blog_springboot.pojo.Blog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface BlogDao extends JpaRepository<Blog,Integer> {
    public List<Blog> findByIsDeleteOrderByCreateTimeDesc(boolean isDelete);
    public Page<Blog> findByIsDeleteOrderByCreateTimeDesc(boolean isDelete,Pageable pageable);
    public Page<Blog> findByIsDeleteAndNewsStatusOrderByCreateTimeDesc(boolean isDelete, Pageable pageable,int newsStatus);
    public Page<Blog> findByIsDeleteAndTypeIdAndNewsStatus(boolean isDelete,int typeId,Pageable pageable,int newsStatus);
    public List<Blog> findByIsDeleteAndNewsTopAndNewsStatusOrderByCreateTimeDesc(boolean isDelete,boolean newsTop,int newsStatus);
    public Page<Blog> findByIsDeleteAndNewsTopAndNewsStatusOrderByCreateTimeDesc(boolean isDelete,boolean newsTop,Pageable pageable,int newsStatus);
    public Page<Blog> findByIsDeleteOrderByClickHitDesc(boolean isDelete,Pageable pageable);
    public Page<Blog> findByIsDeleteAndNewsStatusOrderByCreateTimeDesc(boolean isDelete,int newsStatus,Pageable pageable);
    public Page<Blog> findByIsDeleteAndNewsStatusAndIdInOrderByCreateTimeDesc(boolean isDelete,int newsStatus,int[] blogIdArr,Pageable pageable);
    
    
    
}
